﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace lp_ge_gt
{
    public partial class lpSGT2Geko : Form
    {
        public lpSGT2Geko()
        {
            InitializeComponent();
        }
        private void ustawieniaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            new UstawieniaForm().ShowDialog();
        }
        private void oAutorzeToolStripMenuItem_Click(object sender, EventArgs e)
        {
          //  MessageBox.Show("eeee tam :p ","Wołacz: 0!");
            new AboutBox().ShowDialog();
        }

        private void stanyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                SubiektGT sgt = new SubiektGT();
                Gekosale gs = new Gekosale();
                if (gs.setStock(sgt.getStock()))
                {
                    sgt.truncateStockUpdate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void cenyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                SubiektGT sgt = new SubiektGT();
                Gekosale gs = new Gekosale();
                if (gs.setPrices(sgt.getPrice()))
                {
                    sgt.truncatePriceUpdate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void stanyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                SubiektGT sgt = new SubiektGT();
                Gekosale gs = new Gekosale();
                if (gs.setStock(sgt.getStock(true)))
                {
                    sgt.truncateStockUpdate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void cenyToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                SubiektGT sgt = new SubiektGT();
                Gekosale gs = new Gekosale();
                if (gs.setPrices(sgt.getPrice(true)))
                {
                    sgt.truncatePriceUpdate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
